template: Render collections with appropriate fields#116
Merged
ribose-jeffreylau merged 4 commits intomainfrom Apr 10, 2025
Merged
template: Render collections with appropriate fields#116ribose-jeffreylau merged 4 commits intomainfrom
ribose-jeffreylau merged 4 commits intomainfrom
Conversation
This makes the titles of individual entries in `metanorma site generate` without a generated HTML (e.g., collections) that only have generated PDF/DOC/XML, still contain a valid link (to PDF/DOC/XML), instead of just being plain text. Related: #115
1d6525f to
f4f5a2f
Compare
There was a problem hiding this comment.
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (2)
- spec/assets/with-collections.xml: Language not supported
- templates/_document.liquid: Language not supported
Comments suppressed due to low confidence (2)
spec/relaton/cli/xml_to_html_renderer_spec.rb:46
- [nitpick] Using a hardcoded index [1] to select the second document element may reduce clarity; consider using a more descriptive selector or adding a clarifying comment.
subject(:section) do
document.div(class: 'document')[1]
end
spec/relaton/cli/xml_to_html_renderer_spec.rb:59
- [nitpick] Using numeric indices for selecting document elements may lead to fragile tests if the document order changes; consider iterating directly over the matched elements or using a more robust selection method.
(2..3).map do |i|
document.div(class: 'document')[i]
end.each do |e|
Contributor
Author
|
@andrew2net Similar to relaton/relaton-itu#76, this PR is crucial in fixing metanorma/itu-contribution-samples#4. Would appreciate it if it can be reviewed at your earliest convenience. Thanks! |
Contributor
|
Thanks @ribose-jeffreylau ! @andrew2net can you please review and merge? Thanks. |
andrew2net
approved these changes
Apr 9, 2025
Contributor
|
@ribose-jeffreylau looks good to me, feel free to release |
Contributor
Author
|
@andrew2net Cheers! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses issue #115 and introduces changes to render collections with appropriate fields in the default liquid template. Basically, ensuring that rendered Metanorma collections look good on the site index generated by
metanorma site generate.Relevant tests:
xml_convertor_spec.rb:xml_to_html_renderer_spec.rb:Fixes #115